.class Les/ae$a;
.super Ljava/lang/Object;
.source "EditGIFEncoder.java"

# interfaces
.implements Les/m7$h;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Les/ae;->a(Landroid/view/Surface;)Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field private a:J

.field final synthetic b:Les/ae;


# direct methods
.method constructor <init>(Les/ae;)V
    .locals 2

    .line 1
    iput-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/16 v0, 0x0

    .line 2
    iput-wide v0, p0, Les/ae$a;->a:J

    return-void
.end method


# virtual methods
.method public a(Les/m7;Z)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onDecodeStart"

    .line 1
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a(Les/m7;ZLandroid/media/MediaFormat;)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onOutputFormatReceived"

    .line 4
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a(Les/m7;ZLcom/esfile/screen/recorder/media/util/l;)V
    .locals 5

    .line 5
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->b(Les/ae;)Ljava/util/concurrent/atomic/AtomicBoolean;

    move-result-object p1

    invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result p1

    if-eqz p1, :cond_0

    .line 6
    invoke-virtual {p3}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    .line 7
    :cond_0
    iget-object p1, p3, Lcom/esfile/screen/recorder/media/util/l;->f:Landroid/media/MediaCodec$BufferInfo;

    iget p1, p1, Landroid/media/MediaCodec$BufferInfo;->flags:I

    and-int/lit8 p1, p1, 0x4

    if-eqz p1, :cond_1

    .line 8
    invoke-virtual {p3}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    return-void

    .line 9
    :cond_1
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->a(Les/ae;)Les/ae$b;

    move-result-object p1

    if-eqz p1, :cond_2

    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->a(Les/ae;)Les/ae$b;

    move-result-object p1

    invoke-static {p1}, Les/ae$b;->a(Les/ae$b;)Z

    move-result p1

    if-eqz p1, :cond_2

    .line 10
    invoke-virtual {p3}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    return-void

    .line 11
    :cond_2
    iget-wide p1, p0, Les/ae$a;->a:J

    const-wide/16 v0, 0x0

    const-wide/16 v2, 0x3e8

    cmp-long v4, p1, v0

    if-nez v4, :cond_3

    .line 12
    iget-wide p1, p3, Lcom/esfile/screen/recorder/media/util/l;->c:J

    div-long/2addr p1, v2

    iput-wide p1, p0, Les/ae$a;->a:J

    goto :goto_0

    .line 13
    :cond_3
    iget-wide v0, p3, Lcom/esfile/screen/recorder/media/util/l;->c:J

    div-long/2addr v0, v2

    sub-long/2addr v0, p1

    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->i(Les/ae;)J

    move-result-wide p1

    cmp-long v2, v0, p1

    if-gez v2, :cond_4

    .line 14
    invoke-virtual {p3}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    return-void

    .line 15
    :cond_4
    iget-wide p1, p0, Les/ae$a;->a:J

    iget-object v0, p0, Les/ae$a;->b:Les/ae;

    invoke-static {v0}, Les/ae;->i(Les/ae;)J

    move-result-wide v0

    add-long/2addr p1, v0

    iput-wide p1, p0, Les/ae$a;->a:J

    .line 16
    :goto_0
    :try_start_0
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->b(Les/ae;)Ljava/util/concurrent/atomic/AtomicBoolean;

    move-result-object p1

    invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result p1

    if-nez p1, :cond_5

    .line 17
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->j(Les/ae;)Ljava/util/concurrent/BlockingQueue;

    move-result-object p1

    invoke-interface {p1, p3}, Ljava/util/concurrent/BlockingQueue;->put(Ljava/lang/Object;)V

    .line 18
    :cond_5
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->b(Les/ae;)Ljava/util/concurrent/atomic/AtomicBoolean;

    move-result-object p1

    invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicBoolean;->get()Z

    move-result p1

    if-eqz p1, :cond_6

    .line 19
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->j(Les/ae;)Ljava/util/concurrent/BlockingQueue;

    move-result-object p1

    invoke-interface {p1}, Ljava/util/concurrent/BlockingQueue;->poll()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/esfile/screen/recorder/media/util/l;

    if-eqz p1, :cond_6

    .line 20
    invoke-virtual {p1}, Lcom/esfile/screen/recorder/media/util/l;->a()V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception p1

    .line 21
    invoke-virtual {p1}, Ljava/lang/InterruptedException;->printStackTrace()V

    const/4 p1, 0x1

    .line 22
    invoke-virtual {p3, p1}, Lcom/esfile/screen/recorder/media/util/l;->a(Z)V

    const-string p1, "should not interrupted here."

    .line 23
    invoke-static {p1}, Lcom/esfile/screen/recorder/utils/n;->a(Ljava/lang/String;)V

    :cond_6
    :goto_1
    return-void
.end method

.method public a(Les/m7;ZLjava/lang/Exception;)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onDecodeError"

    .line 2
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 3
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->a(Les/ae;)Les/ae$b;

    move-result-object p1

    invoke-virtual {p1}, Les/ae$b;->b()V

    return-void
.end method

.method public b(Les/m7;Z)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onDecodeStop"

    .line 1
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public b(Les/m7;ZLandroid/media/MediaFormat;)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onInputFormatReceived"

    .line 2
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public c(Les/m7;Z)V
    .locals 0

    const-string p1, "EditGIFEncoder"

    const-string p2, "onDecodeReachEOS"

    .line 1
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 2
    iget-object p1, p0, Les/ae$a;->b:Les/ae;

    invoke-static {p1}, Les/ae;->a(Les/ae;)Les/ae$b;

    move-result-object p1

    invoke-virtual {p1}, Les/ae$b;->stop()V

    return-void
.end method
